<?php

namespace App\Domain;

use App\Model\User as UserModel;

class User
{
    public function login($username, $password)
    {
        $model = new UserModel();
        return $model->login($username, $password);
    }

    public function getUserInfo($userId)
    {
//        $userId = 1;
        $model = new UserModel();
        return $model->getUserInfo($userId);
    }

    public function getUserInfoByUserName($user_name)
    {
        $model = new UserModel();
        return $model->getUserInfoByUserName($user_name);
    }

    public function getUserInfoByEmail($email)
    {
        $model = new UserModel();
        return $model->getUserInfoByEmail($email);
    }

    public function getUserList()
    {
        $model = new UserModel();
        return $model->getUserList();
    }

    public function delUserById($userId)
    {
        $model = new UserModel();
        return $model->delUserById($userId);

    }

    public function insertUserInfo($username, $password, $email, $gender)
    {
        $model = new UserModel();
        return $model->insertUserInfo($username, $password, $email, $gender);
    }

    public function likeQueryByUserName($like_username)
    {
        $model = new UserModel();
        return $model->likeQueryByUserName($like_username);
    }
}